<!DOCTYPE HTML>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CoderM Ad Api Test</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>

<body>

    <div class="container">
        <h1 align="center">CoderM Ad Api Test</h1>
        <hr size=10 color=#111111 align=center noshade />
        <h4 align="left">CMNaticeCall</h4>
        <button type="button" class="btn btn-success btn-block" style="margin-top:20px;" onclick="init();">初始化</button>
        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
            onclick="showAd_Video();">播放广告(激励视频)</button>
        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
            onclick="showAd_Banner();">播放广告(banner)</button>
        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
            onclick="showAd_Interstitial();">播放广告(插屏)</button>

        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
                onclick="showAd_Splash();">播放闪屏广告</button>

        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
                onclick="showAd_Native();">播放原生广告</button>

        <button type="button" class="btn btn-info btn-block" style="margin-top:20px;"
                onclick="showAd_VideoFullScreen();">播放全屏视频广告</button>

        <hr size=10 color=#111111 align=center noshade />
        <div class="alert alert-warning" style="margin-top:20px;" role="alert" id="message"></div>

    </div>

    <script type="text/javascript">
        // 初始化回调
        window.CMJSNativeFunc_InitCallBack = function (arg) {
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_InitCallBack");
            console.log(arg);
        }

        // 激励视频回调
        window.CMJSNativeFunc_VideoAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_RewardVideoCallBack");
            console.log(data);
        }

        // banner回调
        window.CMJSNativeFunc_BannerAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_BannerAdCallBack");
            console.log(data);
        }

        // banner回调
        window.CMJSNativeFunc_InterstitialAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_InterstitialAdCallBack");
            console.log(data);
        }

        // splash 回调
        window.CMJSNativeFunc_SplashAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_SplashAdCallBack");
            console.log(data);
        }

        // Native 回调
        window.CMJSNativeFunc_NativeAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_NativeAdCallBack");
            console.log(data);
        }

        window.CMJSNativeFunc_VideoFullScreenAdCallBack = function (data) {
            /**
             {
                 code:0,        // 正常完成返回0,异常返回1
                 id:rewardId
             }
             */
            console.log("JavaCallJsFunc-----=>  CMJSNativeFunc_VideoFullScreenAdCallBack");
            console.log(data);
        }

        function init() {
            window.CMNativeInterface.init()
        }

        function showAd_Video(rewardId) {
            var rewardId = "23423442_video";
            window.CMNativeInterface.showAdVideo(rewardId)
        }

        function showAd_Banner(rewardId) {
            var rewardId = "23423442_banner";
            window.CMNativeInterface.showAdBanner(rewardId)
        }

        function showAd_Interstitial(rewardId) {
            var rewardId = "23423442_Interstitial";
            window.CMNativeInterface.showAdInterstitial(rewardId)
        }

        function showAd_Splash(rewardId) {
            var rewardId = "23423442_Interstitial";
            window.CMNativeInterface.showAdSplash(rewardId)
        }

        function showAd_Native(rewardId) {
            var rewardId = "23423442_Interstitial";
            window.CMNativeInterface.showAdNative(rewardId)
        }

        function showAd_VideoFullScreen(rewardId) {
            var rewardId = "23423442_Interstitial";
            window.CMNativeInterface.showAdVideoFullScreen(rewardId)
        }

    </script>

</body>

</html>